Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-20.1] hopefully fix NPE for currentUser in addToConversationItems #4612

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Jan 16, 2025

Backport of PR #4611

It seems there could have been a race condition because currentUser was initialized too late.
 I was not able to reproduce but hopefully this fixes it:
 - initialize currentUser earlier (moved from onResume to onCreate)
 - use currentUserProvider instead userManager

NPEs were reported via gplay:

1)
Exception java.lang.NullPointerException:
  at com.nextcloud.talk.conversationlist.ConversationsListActivity.addToConversationItems (ConversationsListActivity.kt:851)
  at com.nextcloud.talk.conversationlist.ConversationsListActivity.access$addToConversationItems (ConversationsListActivity.kt:151)
  at com.nextcloud.talk.conversationlist.ConversationsListActivity$initObservers$5$1.invokeSuspend (ConversationsListActivity.kt:394)
  at com.nextcloud.talk.conversationlist.ConversationsListActivity$initObservers$5$1.invoke (Unknown Source:8)
  at com.nextcloud.talk.conversationlist.ConversationsListActivity$initObservers$5$1.invoke (Unknown Source:4)

2)
Exception java.lang.RuntimeException:
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:5427)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:5508)
  ...
Caused by java.lang.NullPointerException:
  at com.nextcloud.talk.conversationlist.ConversationsListActivity.shouldShowNotificationWarning (ConversationsListActivity.kt:1557)

Signed-off-by: Marcel Hibbe <[email protected]>
@backportbot backportbot bot requested a review from mahibi January 16, 2025 12:49
@backportbot backportbot bot added the 3. to review Waiting for reviews label Jan 16, 2025
@backportbot backportbot bot added this to the 20.1.1 milestone Jan 16, 2025
Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4612-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

Copy link
Contributor

Codacy

Lint

TypemasterPR
Warnings104103
Errors3636

SpotBugs

CategoryBaseNew
Bad practice66
Correctness22216
Dodgy code7171
Internationalization33
Malicious code vulnerability33
Performance44
Security11
Total310104

@mahibi mahibi merged commit 237b6fa into stable-20.1 Jan 16, 2025
15 checks passed
@mahibi mahibi deleted the backport/4611/stable-20.1 branch January 16, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant